package org.dromara.answerFront.controller;


import cn.dev33.satoken.annotation.SaIgnore;
import lombok.RequiredArgsConstructor;
import org.dromara.answer.domain.bo.AiOptionsBo;
import org.dromara.answer.domain.bo.AiQuestionsBo;
import org.dromara.answer.domain.vo.AiQuestionsVo;
import org.dromara.answerFront.service.IFrontQuestionsService;
import org.dromara.common.core.domain.R;
import org.dromara.common.web.core.BaseController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 题目
 *
 * @author Lion Li
 * @date 2025-04-09
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/answer/questions")
public class FrontQuestionsController extends BaseController {

    private final IFrontQuestionsService aiQuestionsService;

    /**
     * 查询题目列表
     */
    @GetMapping("/list")
    public R<List<AiQuestionsVo>> list(AiQuestionsBo bo) {
        return R.ok(aiQuestionsService.queryList(bo));
    }

    /**
     * 插入题目
     */
    @SaIgnore
    @PostMapping("/insert")
    public R insertList(@RequestBody AiQuestionsBo bo) {
        return R.ok(aiQuestionsService.insert(bo));
    }

}
